#ifndef _BSP_UI_INIT_H_
#define _BSP_UI_INIT_H_ 

#include "bsp_lcd.h"
#include "esp_lcd_types.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_heap_caps.h"
#include "esp_lcd_panel_io.h"
#include "esp_lcd_panel_vendor.h"
#include "esp_lcd_panel_ops.h"

#include "lvgl.h"
#include "esp_timer.h"
#include "demos/lv_demos.h"

#define LCD_WIDTH  240
#define LCD_HEIGHT 320

// 添加屏幕方向枚举定义，支持四个方向
typedef enum {
    LCD_ORIENTATION_PORTRAIT,           // 竖屏 (0°)
    LCD_ORIENTATION_LANDSCAPE,          // 横屏 (90°)
    LCD_ORIENTATION_PORTRAIT_INVERTED,  // 反向竖屏 (180°)
    LCD_ORIENTATION_LANDSCAPE_INVERTED  // 反向横屏 (270°)
} lcd_orientation_t;

void lvgl_task(void *arg);
void lv_port_disp_init(void);
void lv_port_indev_init(void);

// 添加方向切换函数声明
bool lv_port_disp_rotation(lcd_orientation_t orientation);

#endif
